1. Field of the Invention
The present invention relates to a magnetic tape apparatus and, more particularly to a magnetic tape apparatus having a function which duplicates data, stores the duplicated data, and restores data when the duplicated data is read, a control method for the magnetic tape apparatus, and a magnetic tape apparatus control program.
2. Description of the Related Art
Many conventional sequential access media such as a magnetic tape are used for data storage such as backup of a database. These backup data are very important data which are required to restore data when the data are broken due to a failure of the apparatus, a disaster, or the like. For this reason, in order to avoid a trouble that data cannot be read due to a failure of a medium after the data is written in a magnetic tape, or in order to store data at a remote place in preparation to a disaster, a process of storing the data in a plurality of magnetic tapes to duplicate the data is popularly performed.
However, even though a magnetic tape medium is copied, and even though data is managed by duplication, when data written in the magnetic tape is to be read to restore a database, the restoring process must be temporarily stopped and then restarted by using a copied medium when an error such as a failure of a magnetic tape apparatus or a failure of a magnetic tape medium occurs. This process is complex, and it may be impossible to restore data. For this reason, the process becomes considerably unstable. A case in which a magnetic tape is used will be compared with a case in which a magnetic disk is used.
For example, in a random access device such as a magnetic disk, data is always read by designating the address of an area in which data such as LBA (Logical Block Address) and the length of data to be read. For this reason, when the data is duplicated, even though a failure of the magnetic disk drive or a failure of the medium occurs, the process can be continued by issuing a read command to another magnetic disk which can be normally operated. At the present, the mirroring by magnetic disks is popularly known as RAID (Redundant Arrays of Independent Disks).
In duplication in the above random access device, at any time, the address of a storage area required to access data is designated, so that desired data can be read. For this reason, in addition to an advantage that data is restored when a failure of a disk drive or a failure of a storage medium occurs, the following techniques are disclosed. That is, duplicated disks are alternately accessed to transfer data to a host device at a rate higher than the read rate of the disk (Japanese Unexamined Patent Publication No. 3-253933). Read commands are simultaneously issued to two disks, the data of a disk from which data can be precedently read is transferred to a host device (Japanese Unexamined Patent Publication No. 3-259321), and read commands are simultaneously issued to two disks, data of a disk on which data read is precedently completed is transferred to a host device (Japanese Unexamined Patent Publication No. 9-237163). Therefore, performance is improved.
However, in a sequential access medium such as a magnetic tape, only written data are sequentially read. When the process is interrupted by an error, even if a copy medium is prepared, a restoring process is restarted by using the copy medium, or a repositioning process which performs positioning up to a specific check point and restarts the process from the check point is necessary. Therefore, in case of a failure, even though a magnetic tape medium is duplicated, a complex recovery process is necessary. In such an aspect that a database must be restored due to a failure or a disaster, the complex recovery process delays recovery of the system. As a result, a great loss is caused.
In addition, on the magnetic disk, even though a recording medium is partially defective, data cannot be read in only an area in which the defect exist. In general, when the recording medium is partially defective, another normal recording area is allocated as an alternative area to avoid the drawback, and the other recording area can be accessed without any problem.
However, on the sequential access medium such as a magnetic tape, when a recording area is partially defective, even though the subsequent data are normally written in the medium, these data cannot be reliably accessed. This is because an amount of data such as the number of blocks written in the defective recording area is not known so that the continuity of the data to data which are subsequently written and can be normally read may not be assured. Therefore, even though a recording area is partially defective, of data written in one roll of magnetic tape medium, all data written after a position where a defect exists may be lost. In particular, in order to increase a recording density on a recent magnetic tape, a technique such as data compression or auto-blocking is installed. A partial defective medium makes it further difficult to decide an amount of data, and an amount of data which is lost by the defective medium is large. Therefore, a greater loss is caused in a failure.